package com.mspbots.core.tsheets;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mspbots.core.AbstractBaseController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 * com.mspbots.core.controller.SheetsTimeController
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/7/26
 */
@RestController
@RequestMapping(path = "sheet-times")
public class SheetsTimeController extends AbstractBaseController<SheetsTime, SheetsTimeService> {

    @GetMapping("analysis-list")
    public Callable analysisList(SheetsTime queryParams) {
        return () -> service.analysisList(queryParams);
    }

    @Override
    @GetMapping("page")
    public Callable selectPage(Page<SheetsTime> page, SheetsTime queryParams) {
        return () -> this.service.analysisPage(page, queryParams);
    }

    @GetMapping("last")
    public Callable findLast(SheetsTime queryParams) {
        return () -> this.service.findLast(queryParams);
    }
}
